<template>
<el-dialog title="详情"
           :close-on-click-modal="false" append-to-body
           :visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
           width="600px">
<el-row :gutter="15" class="">
<el-form ref="elForm" :model="dataForm" size="small" label-width="100px" label-position="right" >
    <template v-if="!loading">
            <el-col :span="8" >
                <el-form-item  label="资产名称"  
 prop="assetName" >
                         <p>{{ dataForm.assetName | dynamicText(assetNameOptions) }} </p>
                </el-form-item>
            </el-col>
            <el-col :span="8" >
                <el-form-item  label="评估基准日"  
 prop="valuationDate" >
                        <p>{{jnpf.toDate(dataForm.valuationDate,"yyyy-MM-dd")}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="8" >
                <el-form-item  label="评估报告日"  
 prop="evaluationDate" >
                        <p>{{jnpf.toDate(dataForm.evaluationDate,"yyyy-MM-dd")}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="8" >
                <el-form-item  label="评估机构"  
 prop="evaluationAgency" >
                        <p>{{dataForm.evaluationAgency}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="8" >
                <el-form-item  label="评估公允总价值"  
 prop="evaluateValue" >
                        <p>{{dataForm.evaluateValue}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="8" >
                <el-form-item  label="公允单位"  
 prop="evaluationUnit" >
                        <p>{{dataForm.evaluationUnit}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="10" >
                <el-form-item  label="公允市场租金"  
 prop="evaluateMarketRent" >
                        <p>{{dataForm.evaluateMarketRent}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="14" >
                <el-form-item  label="备注"  
 prop="notes" >
                        <p>{{dataForm.notes}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="24" >
                <el-form-item  label="评估附件"  
 prop="evaluateFile" >
                    <JNPF-UploadFz    v-model="dataForm.evaluateFile"
 disabled
 detailed  :fileSize="10"  sizeUnit="MB"  :limit="9"  buttonText="点击上传"  >
                </JNPF-UploadFz>
                </el-form-item>
            </el-col>
    </template>
</el-form>
    </el-row>
    <span slot="footer" class="dialog-footer">
        <el-button @click="visible = false"> 取 消</el-button>
    </span>
    </el-dialog>
</template>
<script>
    import request from '@/utils/request'
    import PrintBrowse from '@/components/PrintBrowse'
    import jnpf from '@/utils/jnpf'
    export default {
        components: {PrintBrowse},
        props: [],
        data() {
            return {
                visible: false,
                loading: false,
                printBrowseVisible: false,
                printId: '',
            dataForm: {
                id :'',
                            assetName : "",
                            valuationDate : '',
                            evaluationDate : '',
                            evaluationAgency : "",
                            evaluateValue : 0,
                            evaluationUnit : '',
                            evaluateMarketRent : '',
                            notes : '',
                            evaluateFile : [],
            },
                                assetNameOptions:[{"fullName":"选项一","id":"1"},{"fullName":"选项二","id":"2"}],

        }
        },
        computed: {},
        watch: {},
        created() {

        },
        mounted() {},
        methods: {
            dataInfo(dataAll){
                let _dataAll =dataAll
                        _dataAll.assetName = _dataAll.assetName ? JSON.parse( _dataAll.assetName):[]
                        _dataAll.evaluateFile = _dataAll.evaluateFile ? JSON.parse( _dataAll.evaluateFile):[]
                this.dataForm = _dataAll
            },

            init(id) {
                this.dataForm.id = id || 0;
                this.visible = true;
                this.$nextTick(() => {
                    if(this.dataForm.id){
                        this.loading = true
                        request({
                            url: '/api/example/ZcglZcrzZcpg/detail/'+this.dataForm.id,
                            method: 'get'
                        }).then(res => {
                            this.dataInfo(res.data)
                            this.loading = false
                        })
                    }

                })
            },
        },
    }

</script>
